<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <title>首页轮播 - 后台管理系统</title>
	    <meta name="renderer" content="webkit|ie-comp|ie-stand">
	    <meta name="apple-mobile-web-app-capable" content="yes">
	    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
	    <link rel="stylesheet" type="text/css" href="static/css/font-awesome.min.css"/>
	    <link rel="stylesheet" href="static/css/style.css">
	    <link rel="stylesheet" href="static/layui/css/layui.css"/>
	</head>
	<style type="text/css">
	   #edui1{z-index:1 !important;}
	</style>
	<body>
		<div class="subnav">
			<a href="">首页</a> &gt; <a href="">系统管理</a> &gt; 首页轮播
		</div>
		<div class="main-inner">
			<div class="x-body">
				<div class="layui-main">
					<form class="layui-form myform" action="?m=user&c=notice&a=add" method="post">
						<input type="hidden" name="m" value="{$m}" />
						<input type="hidden" name="c" value="{$c}" />
						<input type="hidden" name="a" value="{$a}" />
						<input type="hidden" name="cid" value="3" />
						
						<div class="layui-form-item">
							<label class="layui-form-label">标题：</label>
							<div class="layui-input-inline"><input type="text" name="title" required="true" value="" placeholder="请输入文章标题" autocomplete="off" class="layui-input"></div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>
						<div class="layui-form-item" style="z-index: 99999;">
							<label class="layui-form-label">选择类别:</label>
							<div class="layui-input-inline">
								<select name="category">
									<option value="">--请选择--</option>
									{loop $cate as $val}
										<option value="{$val['id']}">{$val['title']}</option>
									{/loop}
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否置顶:</label>
							<div class="layui-input-inline"><input type="checkbox" name="istop" lay-skin="switch" lay-text="是|否"></div>
						</div>
						<div class="layui-form-item" style="z-index: 1;">
							<label class="layui-form-label">内容：</label>
							<div class="layui-input-inline">
								{createUEditor()}
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>
			
						<div class="layui-form-item">
							<label for="" class="layui-form-label"></label>
							<div class="layui-input-inline">
								<a class="layui-btn" href='?m=user&c=notice'>返回</a>
								<button class="layui-btn" lay-submit lay-filter="go">确定</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		
	</body>
	<script type="text/javascript" src="static/js/jquery.min.js"></script>
	<script src="static/layui/layui.js" charset="utf-8"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
	layui.use(['form', 'layedit', 'laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer
	  ,layedit = layui.layedit
	  ,laydate = layui.laydate;
	  
	  //日期
	  laydate.render({
	    elem: '#date'
	  });
	  laydate.render({
	    elem: '#date1'
	  });
	  
	  //创建一个编辑器
	  var editIndex = layedit.build('LAY_demo_editor');
	 
	  //自定义验证规则
	  form.verify({
	    title: function(value){
	      if(value.length < 5){
	        return '标题至少得5个字符啊';
	      }
	    }
	    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
	    ,content: function(value){
	      layedit.sync(editIndex);
	    }
	  });
	  
	  //监听指定开关
	  form.on('switch(switchTest)', function(data){
	    layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
	      offset: '6px'
	    });
	    layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
	  });
	  
	  //监听提交
	  form.on('submit(go)', function(data){
	  	$(".myform").submit();
	    return false;
	  });
	});
	</script>

</html>
